import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const red = { template: '<div style="background-color:#de5b5b;color:#fff; font-size:30px;line-height:100px;text-align:center;">base公共页面</div>' }
const yellow = { template: '<div style="background-color:#dee066;color:#fff; font-size:30px;line-height:100px;text-align:center;">B页面</div>' }
const blue = { template: '<div style="background-color:#6680e0;color:#fff; font-size:30px;line-height:100px;text-align:center;">C页面</div>' }


/* 基础路由默认的 */
export default new Router({
    routes: [{
        path: '/login',
        component: () =>
            import ('@/pages/login.vue'),
        name: 'login'
    }]
})

export const actionRouter = [{
    path: '/',
    redirect: '/red',
    name: 'home',
    /* 索引页面· */
    component: () =>
        import ('@/pages/home.vue'),
    children: [
        { path: '/red', name: '公共页面', component: red, },
        { path: '/yellow', name: 'B专访页面', component: yellow, meta: { role: 'B' } },
        { path: '/blue', name: 'C专访页面', component: blue, meta: { role: 'C' } }
    ]
}]